<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>广东国防教育学会</title>
		<meta name="viewport" content="initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.min.css" />
		<link rel="stylesheet" href="http://idangero.us/swiper/dist/css/swiper.min.css" />
		<link rel="stylesheet" href="/Public/Home/activity/css/style.css" />
	</head>
	<body>

<script type="text/javascript" src="/Public/Home/activity/js/jquery-2.1.0.js"></script>
<div class="bar bar-nav">
    <h1 class="title"><?php echo ($data['hotel_name']); ?></h1>
    <i class="icon icon-left" onclick="window.history.go(-1);"></i>
</div>

<nav class="bar bar-tab">
    <a class="tab-item active" href="<?php echo U('Index/index');?>">
        <span class="icon icon-home"></span>
        <span class="tab-label">首页</span>
    </a>
    <a class="tab-item" href="tel:<?php echo ($data['mobile']); ?>">
        <span class="icon iconfont icon-phone"></span>
        <span class="tab-label">咨询</span>
    </a>
   <!-- <a class="tab-item" href="#">
        <span class="icon iconfont icon-account"></span>
        <span class="tab-label">我要加入</span>
    </a>-->
</nav>

<div class="content">
    <div class="hotel_top clearfix">
        <div class="hotel_top_img">
            <img style="width: 144px;height: 144px;" src="<?php echo ($data['smallimage']); ?>">
        </div>
        <div class="hotel_top_text">
            <h3><?php echo ($data['hotel_name']); ?></h3>
            <p><span><i class="iconfont icon-map"></i></span><?php echo ($data['address']); ?></p>
            <p><a href="tel:<?php echo ($data['mobile']); ?>"><span><i class="iconfont icon-phone"></i></span><?php echo ($data['mobile']); ?></a></p>
            <p>访问：<font><?php echo ($data['number']); ?></font></p>
        </div>
    </div>
    <div class="list-block mechan_user" style="margin-top:0rem;margin-bottom:1rem;">
        <form method="post" id="user_hotel_from" onsubmit="return false">
            <input name="hotel_id" type="hidden" value="<?php echo ($data['id']); ?>">
            <ul>
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-name"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">类 型</div>
                            <div class="item-input">
                                <select id="room_cateid" name="room_cateid">
                                    <option value="">请选择房间类型</option>
                                    <option value="1">标准客房</option>
                                    <option value="2">双人客房</option>
                                    <option value="3">豪华套房</option>
                                    <!--<option value="4">其它</option>-->
                                </select>
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-email"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">房间数</div>
                            <div class="item-input">
                                <input value="1" name="room_num" type="text" placeholder="填写房间数量">
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-gender"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">入住人数</div>
                            <div class="item-input">
                                <input value="1" name="user_num" type="text" placeholder="填写你的入住人数">
                            </div>
                        </div>
                    </div>
                </li>
                <!-- Date -->
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-calendar"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">手机号</div>
                            <div class="item-input">
                                <input name="mobile" type="text" placeholder="填写手机号方便联系">
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-calendar"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">日期</div>
                            <div class="item-input">
                                <input name="time" type="date" placeholder="请选择日期" value="<?php echo date('Y-m-d',time());?>">
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <button id="user_hotel" class="button button-fill"
                                style="height:30px;margin:10px auto;width:4rem;">提交
                        </button>
                    </div>
                </li>
            </ul>
        </form>
    </div>
    <div class="buttons-tab mechan-page-tab" style="margin-top:0px;">
        <!-- <a href="#tab1" class="tab-link active button">发布的活动</a> -->
        <a href="#tab2" class="tab-link button active">详情介绍</a>
    </div>
    <div class="content-block row in_tab_list">
        <div class="tabs">

            <!-- <div id="tab1" class="tab in_hot_box activity_1 active">
                <div class="card demo-card-header-pic">
                    <a href="activity.html">
                    <div valign="bottom" class="card-header color-white no-border no-padding">
                        <img class='card-cover' src="img/raw_1498810476.jpeg" alt="">
                    </div>
                    <div class="card-content">
                        <div class="card-content-inner">
                            <p class="hot_list_title">NETech 2017 第二届中国（北京）国际互联网</p>
                            <p class="color-gray">发表于 2015/01/15</p>
                            <p class="color-gray"><span>白云区</span><span>20人已报名</span><span>￥10.00</span></p>
                        </div>
                    </div>
                    </a>
                </div>

                <div class="card demo-card-header-pic">
                    <a href="activity.html">
                    <div valign="bottom" class="card-header color-white no-border no-padding">
                        <img class='card-cover' src="img/raw_1498810476.jpeg" alt="">
                    </div>
                    <div class="card-content">
                        <div class="card-content-inner">
                            <p class="hot_list_title">NETech 2017 第二届中国（北京）国际互联网</p>
                            <p class="color-gray">发表于 2015/01/15</p>
                            <p class="color-gray"><span>白云区</span><span>20人已报名</span><span>￥10.00</span></p>
                        </div>
                    </div>
                    </a>
                </div>

                <div class="card demo-card-header-pic">
                    <a href="activity.html">
                    <div valign="bottom" class="card-header color-white no-border no-padding">
                        <img class='card-cover' src="img/raw_1498810476.jpeg" alt="">
                    </div>
                    <div class="card-content">
                        <div class="card-content-inner">
                            <p class="hot_list_title">NETech 2017 第二届中国（北京）国际互联网</p>
                            <p class="color-gray">发表于 2015/01/15</p>
                            <p class="color-gray"><span>白云区</span><span>20人已报名</span><span>￥10.00</span></p>
                        </div>
                    </div>
                    </a>
                </div>
            </div> -->
            <div id="tab2" class="tab in_hot_box active">
                <?php echo (htmlspecialchars_decode($data['details'])); ?>
                <!--<div class="card demo-card-header-pic">
                    <a href="activity.html">
                    <div valign="bottom" class="card-header color-white no-border no-padding">
                        <img class='card-cover' src="img/raw_1498810476.jpeg" alt="">
                    </div>
                    <div class="card-content">
                        <div class="card-content-inner">
                            <p class="hot_list_title">NETech 2017 第二届中国（北京）国际互联网</p>
                            <p class="color-gray">发表于 2015/01/15</p>
                            <p class="color-gray"><span>白云区</span><span>20人已报名</span><span>￥10.00</span></p>
                        </div>
                    </div>
                    </a>
                </div>

                <div class="card demo-card-header-pic">
                    <a href="activity.html">
                    <div valign="bottom" class="card-header color-white no-border no-padding">
                        <img class='card-cover' src="img/raw_1498810476.jpeg" alt="">
                    </div>
                    <div class="card-content">
                        <div class="card-content-inner">
                            <p class="hot_list_title">NETech 2017 第二届中国（北京）国际互联网</p>
                            <p class="color-gray">发表于 2015/01/15</p>
                            <p class="color-gray"><span>白云区</span><span>20人已报名</span><span>￥10.00</span></p>
                        </div>
                    </div>
                    </a>
                </div>

                <div class="card demo-card-header-pic">
                    <a href="activity.html">
                    <div valign="bottom" class="card-header color-white no-border no-padding">
                        <img class='card-cover' src="img/raw_1498810476.jpeg" alt="">
                    </div>
                    <div class="card-content">
                        <div class="card-content-inner">
                            <p class="hot_list_title">NETech 2017 第二届中国（北京）国际互联网</p>
                            <p class="color-gray">发表于 2015/01/15</p>
                            <p class="color-gray"><span>白云区</span><span>20人已报名</span><span>￥10.00</span></p>
                        </div>
                    </div>
                    </a>
                </div>-->
            </div>
        </div>
    </div>
</div>

<script type="text/javascript" src="http://g.alicdn.com/sj/lib/jquery/dist/jquery.min.js"></script>
<script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
<!--城市选择结束-->
<script src="http://idangero.us/swiper/dist/js/swiper.min.js"></script>
<script type="text/javascript" src="/Public/Home/activity/js/huodon.js"></script>
<script>
    var swiper = new Swiper('.swiper-container', {
        pagination: '.swiper-pagination',
        paginationClickable: true
    });
</script>
</body>
</html>
<link rel="stylesheet" href="/Public/Home/layer_mobile/need/layer.css"/>
<script type="text/javascript" src="/Public/Home/layer_mobile/layer.js"></script>
<script>
    //提交酒店服务
    $("#user_hotel").click(function () {
        var room_cateid = $("select[name='room_cateid']").val();
        var mobile = $("input[name='mobile']").val();
        var room_num = $("input[name='room_num']").val();
        var user_num = $("input[name='user_num']").val();
        var myArray = [
            {'val': room_cateid, 'message': ''},
            {'val': mobile, 'message': '请输入手机号码', 'geshi': '手机格式不正确'},
            {'val': room_num, 'message': '请输入预定房间数'},
            {'val': user_num, 'message': '请输入入住人数'}
        ];

        var mobile_regular = /(1[3-9]\d{9})$/;  //手机

        if (room_cateid == '') {
            message('请选择房间类型');
            return false;
        }

        if (mobile == '') {
            message('请输入手机号码');
            return false;
        }
        if (!mobile_regular.test(mobile)) {
            message('手机格式不正确');
            return false;
        }

        if (room_num == '') {
            message('请输入预定房间数');
            return false;
        }

        if (user_num == '') {
            message('请输入入住人数');
            return false;
        }

        var formdata = $("#user_hotel_from").serialize();
        $.ajax({
            type: "POST",
            url: "<?php echo U('user_hotel');?>",//+tab,
            data: formdata,// 你的formid 搜索表单 序列化提交
            dataType: 'json',
            success: function (data) {
                if (data.status == 1) {
                    message(data.message);
                    $("#user_hotel_from").trigger('reset');

                } else {
                    message(data.message);
                }
            }
        });
    });

    //提示
    function message(msg) {
        layer.open({
            content: msg,
            skin: 'msg',
            time: 2 //2秒后自动关闭
        });
    }
</script>